package day6;

public class demo3 {
    public static void main(String[] args) {


    }

    public String solve(String ss,String tt){
        char[]s=new StringBuffer(ss).reverse().toString().toCharArray();
        char[]t=new StringBuffer(tt).reverse().toString().toCharArray();
        int i=s.length;
        int j=t.length;
        int[] ret=new int[i+j];
int tmp=0;
        for (int k = 0; k <i ; k++) {
            for (int l = 0; l <j ; l++) {
                ret[i+j]+=(s[i]-'0')*(t[j]-'0');
            }
        }
        StringBuffer sb=new StringBuffer();

        for (int k = 0; k <ret.length ; k++) {
            tmp+=ret[k];
            sb.append((char)tmp%10+'0');
            tmp/=10;
        }
        while (tmp!=0){
            sb.append((char)tmp%10+'0');
            tmp/=10;
        }
        int n=sb.length();
        int a=n-1;
        while(n>1&&sb.charAt(a)=='0'){
            sb.deleteCharAt(a--);
        }
        return sb.reverse().toString();

    }

}
